// Data.java

package com.ruoyi.hospital.entity.order;

import com.ruoyi.service.domain.ServiceOrders;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.List;

@lombok.Data
public class HospitalOrderDetailRet {
    private Long orderId;
    private String orderIdVO;
    private String orderCode;
    private String orderStatus;
    private String orderCreateTime;

    private List<HospitalOrderInfo> orderInfo;
    private List<HospitalOrderButton> buttons;

    private HospitalDispatchInfo dispatchInfo;
    private HospitalProofsInfo proofsInfo;
    private HospitalCheckInfo checkInfo;

    private HospitalServeInfo serveInfo;
    private HospitalPaidInfo paidInfo;

    private String orderPayTip = "";
    private String orderProcessTip = "";

    public void init(ServiceOrders order) {
        this.orderId = order.getOrderId();
        this.orderIdVO = order.getOrderCode();
        DateFormat cstFormate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String creatTimeNew = cstFormate.format(order.getOrderCreateTime());
        this.orderCreateTime = creatTimeNew;

        switch (order.getOrderServiceflag()){
            case 3:
            case 5:
            case 6:
            case 7:
                this.setOrderCode("new");
                this.setOrderStatus("新订单");
                break;
            case 8:
                this.setOrderCode("unserved");
                this.setOrderStatus("待服务");
                break;
            case 9:
            case 10:
            case 11:
                this.setOrderCode("serving");
                this.setOrderStatus("服务中");
                break;
            case 12:
            case 13:
                this.setOrderCode("unsettled");
                this.setOrderStatus("结算中");
                break;
            //case 14:
            //case 15:
            //case 16:
            //case 17:
            //    this.setOrderCode("settled");
            //    this.setOrderStatus("已结算");
            //    break;
            case 2:
                this.setOrderCode("canceled");
                this.setOrderStatus("已退单");
                break;
            case 4:
                this.setOrderCode("canceled");
                this.setOrderStatus("已退单");
                break;
        }
        //if("1".equals(order.getOrderUseFlag())){
        //    this.setOrderCode("unpaid");
        //    this.setOrderStatus("待付款");
        //}
        //
        //if((order.getOrderFlag() == 1) || (order.getOrderFlag() == 3) || (order.getOrderFlag() == 4)){
        //    this.setOrderCode("canceled");
        //    this.setOrderStatus("已取消");
        //}


    }


}